package com.guigu.work.feign;

import com.guigu.dispatch.entity.CacheLineUse;
import com.guigu.dispatch.entity.OrderClassify;
import com.guigu.dispatch.entity.OrderClassifyAttach;
import com.guigu.dispatch.entity.OrderClassifyOrder;
import com.guigu.tms.result.R;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @ClassName:DispatchFeign
 * @Description: 调用任务调度模块
 * @Author:taoLong
 * @Date:2021/11/30:20:34 星期二
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@FeignClient(value = "service-dispatch")
public interface DispatchFeign {

    /**
     * 根据订单Id获取缓存线路表
     *
     * @param orderId
     * @return
     */
    @ApiOperation("根据订单Id获取缓存线路表")
    @GetMapping("/dispatch/cache-line-use/findCacheLineById/{orderId}")
    public CacheLineUse findCacheLineById(@PathVariable("orderId") String orderId);

    /**
     * 根据订单Id获取车次车辆司机Id
     *
     * @param orderId
     * @return
     */
    @ApiOperation("根据订单Id获取车次车辆司机Id")
    @GetMapping("/dispatch/cache-line-use/findOrderClassifyAttachByOrderId/{orderId}")
    public OrderClassifyAttach findOrderClassifyAttachByOrderId(@PathVariable("orderId") String orderId);

    /**
     * 根据订单分类Id获取线路Id
     *
     * @param orderClassifyId 订单分类id
     * @return
     */
    @ApiOperation("根据订单分类Id获取线路Id")
    @GetMapping("/dispatch/cache-line-use/getLineByOrderClassifyId/{orderClassifyId}")
    public R<String> getLineByOrderClassifyId(@PathVariable("orderClassifyId") String orderClassifyId);


    /**
     * 根据订单id查询订单分类Id和订单id
     *
     * @param orderId
     * @return
     */
    @ApiOperation("根据订单id查询订单分类Id和订单id")
    @ApiImplicitParam(name = "orderId", value = "订单分类Id")
    @GetMapping("/dispatch/order-classify-order/findByOrderId/{orderId}")
    public R<List<OrderClassifyOrder>> findByOrderId(@PathVariable("orderId") String orderId);


    /**
     * 根据订单分类Id查询订单分类数据
     *
     * @param orderClassifyId 订单分类Id
     * @return
     */
    @ApiOperation("根据订单分类Id查询订单分类数据")
    @GetMapping("/dispatch/order-classify/geOrderClassifyById/{orderClassifyId}")
    public R<OrderClassify> geOrderClassifyById(@PathVariable("orderClassifyId") String orderClassifyId);


    /**
     * 根据订单分类Id查询所对应的车次车辆司机
     *
     * @param orderClassifyId
     * @return
     */
    @ApiOperation("根据订单分类Id查询所对应的车次车辆司机")
    @GetMapping("/dispatch/order-classify-attach/getOrderClassifyAttachById/{orderClassifyId}")
    public R<OrderClassifyAttach> getOrderClassifyAttachById(@PathVariable("orderClassifyId") String orderClassifyId);
}
